1. Field of the Invention
The present invention relates generally to a technology for protecting a temporary data from being lost due to power off, and more particularly, to a memory control method for restoring data in a cache memory, which is employed spare power to supply the cache memory to go on to store data.
2. Description of Related Art
With rapid development of information technology, computer has become an important source for acquiring information, and an important data storage medium. Wherein, operating system is essential to a computer device, because it can provide much more convenience for a user to operate the computer with the aid of the operating system, thus, whether the operating system design is good or bad has significantly impacted on operating convenience for a user and adaptability for the hardware itself, one of the most important parts of operating system is data access, when operating the computer, a cache memory of the computer is to temporarily store a used data, so as to upgrade operating efficiency of the computer, so is the principle of a computer acting as a server; however, when important data being in use is lost for powering off, larger loss will be produced to an individual, an enterprise user, or business operator, wherein, money is the most severe loss, accordingly, there exists a strong need in the art about how to assure that data in the cache memory can not be lost when the computer device is suddenly powered off.
As described above, in order to protect data from being damaged when taking place the above status, a battery backup technique and a correlative hardware device is accordingly produced, the technique is to rewrite a Linux memory management mechanism, and then employ battery to supply spare power to store the temporary data in the memory, such a memory management mechanism is to define a continuous block contained in the memory to allow all of the temporary datum to access in the defined block, once the computer is powered off, the computer will read datum that have not been written back to disk from the continuous block and write them back to disk when system is restarted next time, however, by such a manner, the memory management core in the computer must be changed, and address of the memory block must be redefined, if error is produced when changing the memory management core in the computer, not only the cached datum can not be written back, and error may occur during executing a general program, such result is more severe than that of data lost, moreover, the temporary datum are restored in the cache memory by virtue of such a manner, much more manpower and time will be occupied.
Therefore, there exists a strong need in the art for building a more secure method for restoring temporary datum to disk to solve the drawback of the above-described prior art, so as to make the cache memory datum restored more readily without changing memory management core, thereby reducing the possibility of impact on system.